package labuladong.第三章.twoSum问题;

import java.util.Arrays;

public class Demo01 {
    public static void main(String[] args) {
        int[] arr = {3, 1, 3, 6};
        System.out.println(Arrays.toString(twoSum(arr, 6)));
    }

    public static int[] twoSum(int[] num, int target) {
        for(int i=0; i<num.length; i++) {
            for(int j=i+1; j<num.length; j++) {
                if(num[i] + num[j] == target) {
                    return new int[]{i, j};
                }
            }
        }
        return new int[]{-1, -1};
    }
}
